package com.tnovoselec.android.common.util;

import android.content.Context;
import android.content.res.Resources;
import android.util.TypedValue;

public class Converter {

	private Converter() {
		super();
	}

	/**
	 * Converts density pixels to real pixels
	 * 
	 * @param context
	 * @param dip
	 * @return converted value of dps in pxs
	 */
	public static int dip2Px(Context context, int dip) {
		Resources r = context.getResources();
		return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, r.getDisplayMetrics());
	}
}
